home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / samba / patches / samba-1.017 / samba-1
Encoding:
Text File  |  1995-07-06  |  28.9 KB  |  1,147 lines

  1. diff -u -r --new-file last-version/docs/smb.conf.5 samba-1.9.14alpha8/docs/smb.conf.5
  2. --- last-version/docs/smb.conf.5    Fri Jun 30 18:12:17 1995
  3. +++ samba-1.9.14alpha8/docs/smb.conf.5    Thu Jul  6 16:42:42 1995
  4. @@ -35,6 +35,9 @@
  5.  Any line beginning with a semicolon is ignored, as are lines containing 
  6.  only whitespace.
  7.  
  8. +Any line ending in a \ is "continued" on the next line in the
  9. +customary unix fashion.
  10. +
  11.  The values following the equals sign in parameters are all either a string
  12.  (no quotes needed) or a boolean, which may be given as yes/no, 0/1 or
  13.  true/false. Case is not significant in boolean values, but is preserved
  14. diff -u -r --new-file last-version/docs/smbclient.1 samba-1.9.14alpha8/docs/smbclient.1
  15. --- last-version/docs/smbclient.1    Thu Mar 30 11:34:41 1995
  16. +++ samba-1.9.14alpha8/docs/smbclient.1    Thu Jul  6 17:25:41 1995
  17. @@ -354,6 +354,9 @@
  18.  Parameters to commands may or may not be case sensitive, depending on the
  19.  command.
  20.  
  21. +You can specify file names which have spaces in them by quoting the
  22. +name with double quotes, for example "a long file name".
  23. +
  24.  Parameters shown in square brackets (eg., "[parameter]") are optional. If not
  25.  given, the command will use suitable defaults. Parameters shown in angle
  26.  brackets (eg., "<parameter>") are required.
  27. diff -u -r --new-file last-version/source/Makefile samba-1.9.14alpha8/source/Makefile
  28. --- last-version/source/Makefile    Mon Jul  3 10:00:20 1995
  29. +++ samba-1.9.14alpha8/source/Makefile    Thu Jul  6 17:31:25 1995
  30. @@ -379,6 +379,12 @@
  31.  # FLAGSM = -DCRAY -U__STDC__ -DQUOTAS
  32.  # LIBSM =
  33.  
  34. +# This is for Convex
  35. +# contributed by Victor Balashov <balashov@cv.jinr.dubna.su>
  36. +# and Ulrich Hahn <ulrich.hahn@zdv.uni-tuebingen.de>
  37. +# FLAGSM= -DCONVEX -DSHADOW_PWD
  38. +# LIBSM= 
  39. +
  40.  
  41.  
  42.  ######################################################################
  43. diff -u -r --new-file last-version/source/change-log samba-1.9.14alpha8/source/change-log
  44. --- last-version/source/change-log    Wed Jul  5 18:51:08 1995
  45. +++ samba-1.9.14alpha8/source/change-log    Thu Jul  6 18:08:50 1995
  46. @@ -1497,6 +1497,18 @@
  47.      - fixed MemMove bug (thanks to mass@tanner.com (Massimo
  48.      Sivilotti))
  49.      - released alpha7
  50. +    - rewrote MemMove to be a little more efficient
  51. +    - ipc va_arg bug fix from djg@tas.com (Dave Gesswein)
  52. +    - added check for illegal chars in long filenames
  53. +    - fixed name cache init bug in nmbd
  54. +    - Convex patches from Victor Balashov <balashov@cv.jinr.dubna.su>
  55. +    - timestring() bugfix from staale@spacetec.no
  56. +    - changed %H to give path of forced user if one is set
  57. +    - added quoting to smbclient to allow spaces in filenames
  58. +    - convex and other patches from Ulrich Hahn
  59. +    <ulrich.hahn@zdv.uni-tuebingen.de>
  60. +    - released alpha8
  61. +    
  62.  
  63.  ==========
  64.  todo:
  65. @@ -1508,7 +1520,7 @@
  66.  add option to print more info about locked files (full path, share name
  67.  etc)
  68.  
  69. -sort by inode on opendir?
  70. +add masking to opendir?
  71.  
  72.  rename only if not rdonly?
  73.  
  74. @@ -1519,8 +1531,6 @@
  75.  
  76.  winDD - check uid matching??
  77.  
  78. -problems with : in filenames from Win95 ?
  79. -
  80.  protocol drop back in client to avoid openX etc.
  81.  
  82.  print queue deletion problem with mapped usernames (greyed out)
  83. @@ -1532,8 +1542,6 @@
  84.  handle exported fat drives to a long filename capable client
  85.  
  86.  add check for existance of lpq commands etc (use stat?)
  87. -
  88. -use ACCMODE to mask O_ stuff
  89.  
  90.  example showing popup on login containing "quota -v"
  91.  
  92. diff -u -r --new-file last-version/source/client.c samba-1.9.14alpha8/source/client.c
  93. --- last-version/source/client.c    Wed Jul  5 14:21:55 1995
  94. +++ samba-1.9.14alpha8/source/client.c    Thu Jul  6 17:20:27 1995
  95. @@ -390,11 +390,11 @@
  96.  ****************************************************************************/
  97.  static void cmd_cd(char *inbuf,char *outbuf )
  98.  {
  99. -  char *p;
  100. +  fstring buf;
  101. +  char *p = buf;
  102.    pstring saved_dir;
  103.  
  104. -  p = strtok(NULL,SEPARATORS);
  105. -  if (p)
  106. +  if (next_token(NULL,buf,NULL))
  107.      {
  108.        pstring dname;
  109.        
  110. @@ -899,14 +899,14 @@
  111.  {
  112.    int attribute = aDIR | aSYSTEM | aHIDDEN;
  113.    pstring mask;
  114. -  char *p;
  115. +  fstring buf;
  116. +  char *p=buf;
  117.  
  118.    strcpy(mask,cur_dir);
  119.    if(mask[strlen(mask)-1]!='\\')
  120.      strcat(mask,"\\");
  121.  
  122. -  p = strtok(NULL,SEPARATORS);
  123. -  if (p)
  124. +  if (next_token(NULL,buf,NULL))
  125.      {
  126.        if (*p == '\\')
  127.      strcpy(mask,p);
  128. @@ -1346,19 +1346,16 @@
  129.    strcpy(rname,cur_dir);
  130.    strcat(rname,"\\");
  131.  
  132. -  p = strtok(NULL,SEPARATORS);
  133. -  if (!p)
  134. -    {
  135. -      DEBUG(0,("get <filename>\n"));
  136. -      return;
  137. -    }
  138. -  strcat(rname,p); 
  139. -  dos_clean_name(rname);
  140. -  strcpy(lname,p);
  141. +  p = rname + strlen(rname);
  142.  
  143. -  p = strtok(NULL,SEPARATORS);
  144. -  if (p)
  145. -    strcpy(lname,p);      
  146. +  if (!next_token(NULL,p,NULL)) {
  147. +    DEBUG(0,("get <filename>\n"));
  148. +    return;
  149. +  }
  150. +  strcpy(lname,p);
  151. +  dos_clean_name(rname);
  152. +    
  153. +  next_token(NULL,lname,NULL);
  154.  
  155.    do_get(rname,lname,NULL);
  156.  }
  157. @@ -1455,7 +1452,8 @@
  158.  {
  159.    int attribute = aSYSTEM | aHIDDEN;
  160.    pstring mget_mask;
  161. -  char *p;
  162. +  fstring buf;
  163. +  char *p=buf;
  164.  
  165.    *mget_mask = 0;
  166.  
  167. @@ -1464,7 +1462,7 @@
  168.  
  169.    abort_mget = False;
  170.  
  171. -  while ((p = strtok(NULL,SEPARATORS)))
  172. +  while (next_token(NULL,p,NULL))
  173.      {
  174.        strcpy(mget_mask,cur_dir);
  175.        if(mget_mask[strlen(mget_mask)-1]!='\\')
  176. @@ -1539,12 +1537,12 @@
  177.  static void cmd_mkdir(char *inbuf,char *outbuf)
  178.  {
  179.    pstring mask;
  180. -  char *p;
  181. +  fstring buf;
  182. +  char *p=buf;
  183.    
  184.    strcpy(mask,cur_dir);
  185.  
  186. -  p = strtok(NULL,SEPARATORS);
  187. -  if (!p)
  188. +  if (!next_token(NULL,p,NULL))
  189.      {
  190.        if (!recurse)
  191.      DEBUG(0,("mkdir <dirname>\n"));
  192. @@ -1824,23 +1822,23 @@
  193.  {
  194.    pstring lname;
  195.    pstring rname;
  196. -  char *p;
  197. +  fstring buf;
  198. +  char *p=buf;
  199.    file_info finfo;
  200.    finfo = def_finfo;
  201.    
  202.    strcpy(rname,cur_dir);
  203.    strcat(rname,"\\");
  204.    
  205. -  p = strtok(NULL,SEPARATORS);
  206. -  if (!p)
  207. +  
  208. +  if (!next_token(NULL,p,NULL))
  209.      {
  210.        DEBUG(0,("put <filename>\n"));
  211.        return;
  212.      }
  213.    strcpy(lname,p);
  214.    
  215. -  p = strtok(NULL,SEPARATORS);
  216. -  if (p)
  217. +  if (next_token(NULL,p,NULL))
  218.      strcat(rname,p);      
  219.    else
  220.      strcat(rname,lname);
  221. @@ -1880,11 +1878,8 @@
  222.  ****************************************************************************/
  223.  static void cmd_select(void)
  224.  {
  225. -  char *p = strtok(NULL,SEPARATORS);
  226. -  if (p)
  227. -    strcpy(fileselection,p);
  228. -  else
  229. -    strcpy(fileselection,"");
  230. +  strcpy(fileselection,"");
  231. +  next_token(NULL,fileselection,NULL);
  232.  }
  233.  
  234.  
  235. @@ -1896,12 +1891,13 @@
  236.    pstring lname;
  237.    pstring rname;
  238.    file_info finfo;
  239. -  char *p;
  240. +  fstring buf;
  241. +  char *p=buf;
  242.  
  243.    finfo = def_finfo;
  244.  
  245.    
  246. -  while ((p = strtok(NULL,SEPARATORS)))
  247. +  while (next_token(NULL,p,NULL))
  248.      {
  249.        pstring cmd;
  250.        pstring tmpnam;
  251. @@ -2020,7 +2016,7 @@
  252.  ****************************************************************************/
  253.  static void cmd_cancel(char *inbuf,char *outbuf )
  254.  {
  255. -  char *p;
  256. +  fstring buf;
  257.    int job; 
  258.  
  259.    if (!connect_as_printer)
  260. @@ -2029,15 +2025,14 @@
  261.        DEBUG(0,("Trying to cancel print jobs without -P may fail\n"));
  262.      }
  263.  
  264. -  p = strtok(NULL,SEPARATORS);
  265. -  if (!p) {
  266. +  if (!next_token(NULL,buf,NULL)) {
  267.      printf("cancel <jobid> ...\n");
  268.      return;
  269.    }
  270. -  for (;p;p=strtok(NULL,SEPARATORS)) {
  271. -    job = atoi(p);
  272. +  do {
  273. +    job = atoi(buf);
  274.      do_cancel(job);
  275. -  }
  276. +  } while (next_token(NULL,buf,NULL));
  277.  }
  278.  
  279.  
  280. @@ -2059,13 +2054,11 @@
  281.        DEBUG(0,("Trying to print without -P may fail\n"));
  282.      }
  283.  
  284. -  p = strtok(NULL,SEPARATORS);
  285. -  if (!p)
  286. +  if (!next_token(NULL,lname,NULL))
  287.      {
  288.        DEBUG(0,("print <filename>\n"));
  289.        return;
  290.      }
  291. -  strcpy(lname,p);
  292.  
  293.    strcpy(rname,lname);
  294.    p = strrchr(rname,'/');
  295. @@ -2307,21 +2300,20 @@
  296.  static void cmd_del(char *inbuf,char *outbuf )
  297.  {
  298.    pstring mask;
  299. -  char *p;
  300. +  fstring buf;
  301.    int attribute = aSYSTEM | aHIDDEN;
  302.  
  303.    if (recurse)
  304.      attribute |= aDIR;
  305.    
  306.    strcpy(mask,cur_dir);
  307. -  
  308. -  p = strtok(NULL,SEPARATORS);
  309. -  if (!p)
  310. +    
  311. +  if (!next_token(NULL,buf,NULL))
  312.      {
  313.        DEBUG(0,("del <filename>\n"));
  314.        return;
  315.      }
  316. -  strcat(mask,p);
  317. +  strcat(mask,buf);
  318.  
  319.    do_dir((char *)inbuf,(char *)outbuf,mask,attribute,do_del,False);
  320.  }
  321. @@ -2333,18 +2325,17 @@
  322.  static void cmd_rmdir(char *inbuf,char *outbuf )
  323.  {
  324.    pstring mask;
  325. +  fstring buf;
  326.    char *p;
  327.    
  328.    strcpy(mask,cur_dir);
  329.    
  330. -  p = strtok(NULL,SEPARATORS);
  331. -  if (!p)
  332. +  if (!next_token(NULL,buf,NULL))
  333.      {
  334.        DEBUG(0,("rmdir <dirname>\n"));
  335.        return;
  336.      }
  337. -  strcat(mask,p);
  338. -
  339. +  strcat(mask,buf);
  340.  
  341.    bzero(outbuf,smb_size);
  342.    set_message(outbuf,0,2 + strlen(mask),True);
  343. @@ -2384,10 +2375,12 @@
  344.  ****************************************************************************/
  345.  static void cmd_newer(void)
  346.  {
  347. -  char *p = strtok(NULL,SEPARATORS);
  348. +  fstring buf;
  349. +  BOOL ok;
  350.    struct stat sbuf;
  351.  
  352. -  if (p && (stat(p,&sbuf) == 0))
  353. +  ok = next_token(NULL,buf,NULL);
  354. +  if (ok && (stat(buf,&sbuf) == 0))
  355.      {
  356.        newer_than = sbuf.st_mtime + GMT_TO_LOCAL*TimeDiff(sbuf.st_mtime);
  357.        DEBUG(1,("Getting files newer than %s",asctime(LocalTime(&newer_than,0))));
  358. @@ -2395,7 +2388,7 @@
  359.    else
  360.      newer_than = 0;
  361.  
  362. -  if (p && newer_than == 0)
  363. +  if (ok && newer_than == 0)
  364.      DEBUG(0,("Error setting newer-than time\n"));
  365.  }
  366.  
  367. @@ -2404,11 +2397,11 @@
  368.  ****************************************************************************/
  369.  static void cmd_archive(void)
  370.  {
  371. -  char *p = strtok(NULL,SEPARATORS);
  372. +  fstring buf;
  373.  
  374. -  if (p)
  375. -    archive_level = atoi(p);
  376. -  else
  377. +  if (next_token(NULL,buf,NULL)) {
  378. +    archive_level = atoi(buf);
  379. +  } else
  380.      DEBUG(0,("Archive level is %d\n",archive_level));
  381.  }
  382.  
  383. @@ -2449,20 +2442,19 @@
  384.  ****************************************************************************/
  385.  static void cmd_printmode(void)
  386.  {
  387. -  char *p;
  388. -  pstring mode;
  389. +  fstring buf;
  390. +  fstring mode;
  391.  
  392. -  p = strtok(NULL,SEPARATORS);
  393. -  if (p)
  394. +  if (next_token(NULL,buf,NULL))
  395.      {
  396. -      if (strequal(p,"text"))
  397. +      if (strequal(buf,"text"))
  398.      printmode = 0;      
  399.        else
  400.      {
  401. -      if (strequal(p,"graphics"))
  402. +      if (strequal(buf,"graphics"))
  403.          printmode = 1;
  404.        else
  405. -        printmode = atoi(p);
  406. +        printmode = atoi(buf);
  407.      }
  408.      }
  409.  
  410. @@ -2487,12 +2479,11 @@
  411.  ****************************************************************************/
  412.  static void cmd_lcd(void)
  413.  {
  414. -  char *p;
  415. +  fstring buf;
  416.    pstring d;
  417.  
  418. -  p = strtok(NULL,SEPARATORS);
  419. -  if (p)
  420. -    chdir(p);
  421. +  if (next_token(NULL,buf,NULL))
  422. +    chdir(buf);
  423.    DEBUG(2,("the local directory is now %s\n",GetWd(d)));
  424.  }
  425.  
  426. @@ -3230,14 +3221,13 @@
  427.  void cmd_help(void)
  428.  {
  429.    int i=0;
  430. -  char *p;
  431. +  fstring buf;
  432.  
  433. -  p = strtok(NULL,SEPARATORS);
  434. -  if (p)
  435. +  if (next_token(NULL,buf,NULL))
  436.      {
  437.        while (commands[i].description)
  438.      {
  439. -      if (strequal(commands[i].name,p))      
  440. +      if (strequal(commands[i].name,buf))      
  441.          DEBUG(0,("HELP %s:\n\t%s\n\n",commands[i].name,commands[i].description));
  442.        i++;
  443.      }
  444. @@ -3436,7 +3426,7 @@
  445.  
  446.    while (!feof(stdin))
  447.      {
  448. -      char *tok;
  449. +      fstring tok;
  450.        int i;
  451.        BOOL found = False;
  452.  
  453. @@ -3473,7 +3463,10 @@
  454.      }
  455.        
  456.        /* and get the first part of the command */
  457. -      tok = strtok(line,SEPARATORS);
  458. +      {
  459. +    char *ptr = line;
  460. +    if (!next_token(&ptr,tok,NULL)) continue;
  461. +      }
  462.        
  463.        i = 0;
  464.        while (commands[i].fn != NULL)
  465. @@ -3485,7 +3478,7 @@
  466.          }
  467.        i++;
  468.      }
  469. -      if (!found && tok)
  470. +      if (!found)
  471.      DEBUG(0,("%s: command not found\n",CNV_LANG(tok)));
  472.      }
  473.    
  474. diff -u -r --new-file last-version/source/clitar.c samba-1.9.14alpha8/source/clitar.c
  475. --- last-version/source/clitar.c    Tue Jul  4 12:01:26 1995
  476. +++ samba-1.9.14alpha8/source/clitar.c    Thu Jul  6 17:37:58 1995
  477. @@ -1208,17 +1208,16 @@
  478.  
  479.  void cmd_block(void)
  480.  {
  481. -  char *p;
  482. +  fstring buf;
  483.    int block;
  484.  
  485. -  p=strtok(NULL, SEPARATORS);
  486. -  if (!p)
  487. +  if (!next_token(NULL,buf,NULL))
  488.      {
  489.        DEBUG(0, ("blocksize <n>\n"));
  490.        return;
  491.      }
  492.  
  493. -  block=atoi(p);
  494. +  block=atoi(buf);
  495.    if (block < 0 || block > 65535)
  496.      {
  497.        DEBUG(0, ("blocksize out of range"));
  498. @@ -1231,18 +1230,18 @@
  499.  
  500.  void cmd_tarmode(void)
  501.  {
  502. -  char *p;
  503. +  fstring buf;
  504.  
  505. -  while ((p=strtok(NULL, SEPARATORS))) {
  506. -    if (strequal(p, "full"))
  507. +  while (next_token(NULL,buf,NULL)) {
  508. +    if (strequal(buf, "full"))
  509.        tar_inc=False;
  510. -    else if (strequal(p, "inc"))
  511. +    else if (strequal(buf, "inc"))
  512.        tar_inc=True;
  513. -    else if (strequal(p, "reset"))
  514. +    else if (strequal(buf, "reset"))
  515.        tar_reset=True;
  516. -    else if (strequal(p, "noreset"))
  517. +    else if (strequal(buf, "noreset"))
  518.        tar_reset=False;
  519. -    else DEBUG(0, ("tarmode: unrecognised option %s\n", p));
  520. +    else DEBUG(0, ("tarmode: unrecognised option %s\n", buf));
  521.    }
  522.  
  523.    DEBUG(0, ("tarmode is now %s, %s\n",
  524. @@ -1254,23 +1253,23 @@
  525.  
  526.  void cmd_setmode(void)
  527.  {
  528. -  char *p, *q;
  529. +  char *q;
  530. +  fstring buf;
  531.    pstring fname;
  532.    int attra[2]={0, 0};
  533.    int direct=1;
  534.  
  535. -  p=strtok(NULL, SEPARATORS);
  536. -  if (!p)
  537. +  if (!next_token(NULL,buf,NULL))
  538.      {
  539.        DEBUG(0, ("setmode <filename> <perm=[+|-]rsha>\n"));
  540.        return;
  541.      }
  542.  
  543.    strcpy(fname, cur_dir);
  544. -  strcat(fname, p);
  545. +  strcat(fname, buf);
  546.  
  547. -  while ((p=strtok(NULL, SEPARATORS))) {
  548. -    q=p;
  549. +  while (next_token(NULL,buf,NULL)) {
  550. +    q=buf;
  551.  
  552.      while(*q)
  553.        switch (*q++) {
  554. @@ -1310,18 +1309,17 @@
  555.  {
  556.    int attribute = aDIR | aSYSTEM | aHIDDEN;
  557.    pstring ffname, tarmac;
  558. -  char *p;
  559. +  fstring buf;
  560. +  char *p = buf;
  561.  
  562. -  p = strtok(NULL,SEPARATORS);
  563. -  if (!p)
  564. +  if (!next_token(NULL,buf,NULL))
  565.      {
  566.        DEBUG(0,("tar [c|x] <filename>\n"));
  567.        return;
  568.      }
  569.  
  570.    if (*p == 'c') {
  571. -    p = strtok(NULL,SEPARATORS);
  572. -    if (!p)
  573. +    if (!next_token(NULL,buf,NULL))
  574.        {
  575.      DEBUG(0,("tar [c|x] <filename> [<tar mask>]\n"));
  576.      return;
  577. @@ -1343,7 +1341,7 @@
  578.      initarbuf();
  579.  
  580.      strcpy(tarmac,cur_dir);
  581. -    if ((p = strtok(NULL,SEPARATORS)))
  582. +    if (next_token(NULL,buf,NULL))
  583.        do {
  584.      if(tarmac[strlen(tarmac)-1]!='\\')
  585.        strcat(tarmac,"\\");
  586. @@ -1352,7 +1350,7 @@
  587.        strcpy(tarmac,p);
  588.      else
  589.        strcat(tarmac,p);
  590. -      } while ((p = strtok(NULL,SEPARATORS)));
  591. +      } while (next_token(NULL,buf,NULL));
  592.      else
  593.        strcat(tarmac,"*.*");
  594.      
  595. @@ -1365,8 +1363,7 @@
  596.      DEBUG(0, ("tar: dumped %d tar files\n", ntarf));
  597.    }
  598.    else if (*p=='x') {
  599. -    p = strtok(NULL,SEPARATORS);
  600. -    if (!p)
  601. +    if (!next_token(NULL,buf,NULL))
  602.        {
  603.      DEBUG(0,("tar [c|x] <filename> [<tar mask>]\n"));
  604.      return;
  605. diff -u -r --new-file last-version/source/includes.h samba-1.9.14alpha8/source/includes.h
  606. --- last-version/source/includes.h    Wed Jul  5 00:55:26 1995
  607. +++ samba-1.9.14alpha8/source/includes.h    Thu Jul  6 17:42:16 1995
  608. @@ -156,7 +156,7 @@
  609.  #include <pwdadj.h>
  610.  #endif
  611.  
  612. -#if defined(SHADOW_PWD) && !defined(NETBSD)
  613. +#if defined(SHADOW_PWD) && !defined(NETBSD) && !defined(CONVEX)
  614.  #include <shadow.h>
  615.  #endif
  616.  
  617. @@ -662,6 +662,24 @@
  618.  #define ftruncate(f,l) chsize(f,l)
  619.  #endif /* DNIX */
  620.  
  621. +#ifdef CONVEX
  622. +#define SIGNAL_CAST (void (*)(int))
  623. +#include <netinet/tcp.h>
  624. +#include <arpa/inet.h>
  625. +#include <dirent.h>
  626. +#include <string.h>
  627. +#include <sys/vfs.h>
  628. +#include <netinet/in.h>
  629. +#include <errno.h>
  630. +#include <sys/wait.h>
  631. +#include <signal.h>
  632. +#include <fcntl.h>
  633. +#define DONT_REINSTALL_SIG
  634. +#define USE_SIGBLOCK
  635. +#define USE_WAITPID
  636. +#define SIGNAL_CAST (_SigFunc_Ptr_t)
  637. +#define NO_GETSPNAM
  638. +#endif
  639.  
  640.  
  641.  #ifdef CRAY
  642. diff -u -r --new-file last-version/source/ipc.c samba-1.9.14alpha8/source/ipc.c
  643. --- last-version/source/ipc.c    Wed Jul  5 16:43:41 1995
  644. +++ samba-1.9.14alpha8/source/ipc.c    Thu Jul  6 14:42:19 1995
  645. @@ -28,6 +28,11 @@
  646.  #include "loadparm.h"
  647.  #include "pcap.h"
  648.  
  649. +#ifdef CHECK_TYPES
  650. +#undef CHECK_TYPES
  651. +#endif
  652. +#define CHECK_TYPES 0
  653. +
  654.  extern int DEBUGLEVEL;
  655.  extern int maxxmit;
  656.  extern files_struct Files[];
  657. @@ -271,6 +276,7 @@
  658.    int needed=0, stringneeded;
  659.    char* str=NULL;
  660.    int is_string=0, stringused;
  661. +  int32 temp;
  662.  
  663.  #ifdef __STDC__
  664.    va_start(args,p);
  665. @@ -300,7 +306,8 @@
  666.    switch( *p->curpos++ ) {
  667.    case 'W':            /* word (2 byte) */
  668.      needed = 2;
  669. -    if (p->buflen >= needed) SSVAL(p->structbuf,0,va_arg(args,int16));
  670. +    temp = va_arg(args,int16);
  671. +    if (p->buflen >= needed) SSVAL(p->structbuf,0,temp);
  672.      break;
  673.    case 'N':            /* count of substructures (word) at end */
  674.      needed = 2;
  675. @@ -309,7 +316,8 @@
  676.      break;
  677.    case 'D':            /* double word (4 byte) */
  678.      needed = 4;
  679. -    if (p->buflen >= needed) SIVAL(p->structbuf,0,va_arg(args,int32));
  680. +    temp = va_arg(args,int32);
  681. +    if (p->buflen >= needed) SIVAL(p->structbuf,0,temp);
  682.      break;
  683.    case 'B':            /* byte (with optional counter) */
  684.      needed = get_counter(&p->curpos);
  685. diff -u -r --new-file last-version/source/local.h samba-1.9.14alpha8/source/local.h
  686. --- last-version/source/local.h    Tue Jul  4 15:11:52 1995
  687. +++ samba-1.9.14alpha8/source/local.h    Thu Jul  6 13:50:28 1995
  688. @@ -61,6 +61,14 @@
  689.  #define LPQ_COMMAND "lpq -P"
  690.  #endif
  691.  
  692. +/* shall guest entries in printer queues get changed to user entries,
  693. +   so they can be deleted using the windows print manager? */
  694. +#define LPQ_GUEST_TO_USER
  695. +
  696. +/* shall filenames with illegal chars in them get mangled in long
  697. +   filename listings? */
  698. +#define MANGLE_LONG_FILENAMES
  699. +
  700.  /* define this if you want to stop spoofing with .. and soft links
  701.     NOTE: This also slows down the server considerably */
  702.  #define REDUCE_PATHS
  703. diff -u -r --new-file last-version/source/nameserv.c samba-1.9.14alpha8/source/nameserv.c
  704. --- last-version/source/nameserv.c    Wed Jul  5 13:56:10 1995
  705. +++ samba-1.9.14alpha8/source/nameserv.c    Thu Jul  6 17:51:39 1995
  706. @@ -97,11 +97,17 @@
  707.  ****************************************************************************/
  708.  static int sig_hup()
  709.  {
  710. +  BlockSignals(True);
  711. +
  712.    DEBUG(0,("Got SIGHUP - not implemented\n"));
  713.    dump_names();
  714.    if (!is_daemon)
  715.      exit(1);
  716. +
  717. +  BlockSignals(False);
  718. +#ifndef DONT_REINSTALL_SIG
  719.    signal(SIGHUP,SIGNAL_CAST sig_hup);
  720. +#endif
  721.    return(0);
  722.  }
  723.  
  724. @@ -110,9 +116,12 @@
  725.  ****************************************************************************/
  726.  static int sig_pipe()
  727.  {
  728. +  BlockSignals(True);
  729. +
  730.    DEBUG(0,("Got SIGPIPE\n"));
  731.    if (!is_daemon)
  732.      exit(1);
  733. +  BlockSignals(False);
  734.    return(0);
  735.  }
  736.  
  737. @@ -155,31 +164,29 @@
  738.  static int add_name(void)
  739.  {
  740.    int i;
  741. -  name_struct *n;
  742.  
  743.    for (i=0;i<num_names;i++)
  744.      if (!names[i].valid)
  745. -      return(i);
  746. +      break;
  747.  
  748. -  if (num_names == 0)    
  749. -    n = (name_struct *)malloc(sizeof(name_struct));
  750. -  else
  751. -    n = (name_struct *)realloc(names,sizeof(name_struct)*(num_names+1));
  752. -  if (!n) 
  753. -    {
  754. +  if (i==num_names) {
  755. +    name_struct *n;
  756. +    if (num_names == 0)    
  757. +      n = (name_struct *)malloc(sizeof(name_struct));
  758. +    else
  759. +      n = (name_struct *)realloc(names,sizeof(name_struct)*(num_names+1));
  760. +    if (!n) {
  761.        DEBUG(0,("Can't malloc more names space!\n"));
  762.        return(-1);
  763.      }
  764. -  n[num_names].valid = False;
  765. -  n[num_names].found_master = False;
  766. -  n[num_names].isgroup = False;
  767. -  n[num_names].unicast = False;
  768. -  strcpy(n[num_names].name,"");
  769. -  n[num_names].ttl = 0;
  770. -  n[num_names].start_time = 0;
  771. -  names = n;
  772. -  num_names++;
  773. -  return(num_names-1);
  774. +    i = num_names;
  775. +    num_names++;
  776. +    names = n;
  777. +  }
  778. +
  779. +  bzero(&names[i],sizeof(names[i]));
  780. +
  781. +  return(i);
  782.  }
  783.  
  784.  /****************************************************************************
  785. diff -u -r --new-file last-version/source/params.c samba-1.9.14alpha8/source/params.c
  786. --- last-version/source/params.c    Mon Jul  3 12:04:10 1995
  787. +++ samba-1.9.14alpha8/source/params.c    Thu Jul  6 17:27:20 1995
  788. @@ -259,7 +259,7 @@
  789.     if (pszParmFile == NULL || strlen(pszParmFile) < 1)
  790.        DEBUG(0,( "No configuration filename specified!\n"));
  791.     else
  792. -      if ((fileIn = fopen(pszParmFile, "rt")) == NULL)
  793. +      if ((fileIn = fopen(pszParmFile, "r")) == NULL)
  794.           DEBUG(0,( "Unable to open configuration file \"%s\"!\n", pszParmFile));
  795.        else
  796.        {
  797. diff -u -r --new-file last-version/source/password.c samba-1.9.14alpha8/source/password.c
  798. --- last-version/source/password.c    Wed Jul  5 17:29:44 1995
  799. +++ samba-1.9.14alpha8/source/password.c    Thu Jul  6 17:46:42 1995
  800. @@ -143,7 +143,7 @@
  801.                         char *p, *q;
  802.  
  803.                         p=line+strlen(username)+1;
  804. -                       if (q=strchr(p, ':')) {
  805. +                       if ((q=strchr(p, ':'))) {
  806.                                 *q=0;
  807.                                 if (q-p+1>20)
  808.                                         break;
  809. diff -u -r --new-file last-version/source/printing.c samba-1.9.14alpha8/source/printing.c
  810. --- last-version/source/printing.c    Wed Jul  5 14:01:05 1995
  811. +++ samba-1.9.14alpha8/source/printing.c    Thu Jul  6 17:48:00 1995
  812. @@ -444,9 +444,9 @@
  813.  }
  814.  
  815.  
  816. -char *stat0_strings[] = { "enabled", "online", "idle", NULL };
  817. -char *stat1_strings[] = { "offline", "disabled", "down", "off", NULL };
  818. -char *stat2_strings[] = { "jam", "paper", "error", "responding", "not accepting", "not running", NULL };
  819. +char *stat0_strings[] = { "enabled", "online", "idle", "no entries", "free", "ready", NULL };
  820. +char *stat1_strings[] = { "offline", "disabled", "down", "off", "waiting", "no daemon", NULL };
  821. +char *stat2_strings[] = { "jam", "paper", "error", "responding", "not accepting", "not running", "turned off", NULL };
  822.  
  823.  /****************************************************************************
  824.  parse a lpq line. Choose printing style
  825. @@ -473,6 +473,7 @@
  826.        break;
  827.      }
  828.  
  829. +#ifdef LPQ_GUEST_TO_USER
  830.    if (ret) {
  831.      extern pstring sesssetup_user;
  832.      /* change guest entries to the current logged in user to make
  833. @@ -480,6 +481,7 @@
  834.      if (sesssetup_user[0] && strequal(buf->user,lp_guestaccount(snum)))
  835.        strcpy(buf->user,sesssetup_user);
  836.    }
  837. +#endif
  838.  
  839.    if (status && !ret)
  840.      {
  841. diff -u -r --new-file last-version/source/server.c samba-1.9.14alpha8/source/server.c
  842. --- last-version/source/server.c    Wed Jul  5 17:31:14 1995
  843. +++ samba-1.9.14alpha8/source/server.c    Thu Jul  6 17:54:31 1995
  844. @@ -1526,6 +1526,7 @@
  845.      }
  846.    depth++;
  847.  
  848. +  BlockSignals(True);
  849.    DEBUG(5,("got SIGCLD\n"));
  850.  
  851.  #ifdef USE_WAITPID
  852. @@ -1539,16 +1540,19 @@
  853.       child that has exited. This would lead to an infinite recursion
  854.       if done vice versa. */
  855.          
  856. +#ifndef DONT_REINSTALL_SIG
  857.  #ifdef SIGCLD_IGNORE
  858.    signal(SIGCLD, SIG_IGN);  
  859.  #else
  860.    signal(SIGCLD, SIGNAL_CAST sig_cld);
  861.  #endif
  862. +#endif
  863.  
  864.  #ifndef USE_WAITPID
  865.    while (wait3(WAIT3_CAST1 NULL, WNOHANG, WAIT3_CAST2 NULL) > 0);
  866.  #endif
  867.    depth--;
  868. +  BlockSignals(False);
  869.    return 0;
  870.  }
  871.  #endif
  872. @@ -1816,11 +1820,13 @@
  873.  ****************************************************************************/
  874.  static int sig_hup()
  875.  {
  876. +  BlockSignals(True);
  877.    DEBUG(0,("Got SIGHUP\n"));
  878.    reload_services(False);
  879. -#ifndef NO_SIGNAL_TEST
  880. +#ifndef DONT_REINSTALL_SIG
  881.    signal(SIGHUP,SIGNAL_CAST sig_hup);
  882.  #endif
  883. +  BlockSignals(False);
  884.    return(0);
  885.  }
  886.  
  887. @@ -1943,15 +1949,6 @@
  888.    string_set(&Connections[cnum].dirpath,"");
  889.    string_set(&Connections[cnum].user,user);
  890.  
  891. -  {
  892. -    pstring s;
  893. -    strcpy(s,lp_pathname(snum));
  894. -    standard_sub(cnum,s);
  895. -    string_set(&Connections[cnum].connectpath,s);
  896. -    DEBUG(3,("Connect path is %s\n",s));
  897. -  }
  898. -
  899. -
  900.  #if HAVE_GETGRNAM 
  901.    if (*lp_force_group(snum))
  902.      {
  903. @@ -1982,6 +1979,14 @@
  904.        else
  905.      DEBUG(1,("Couldn't find user %s\n",fuser));
  906.      }
  907. +
  908. +  {
  909. +    pstring s;
  910. +    strcpy(s,lp_pathname(snum));
  911. +    standard_sub(cnum,s);
  912. +    string_set(&Connections[cnum].connectpath,s);
  913. +    DEBUG(3,("Connect path is %s\n",s));
  914. +  }
  915.  
  916.    /* groups stuff added by ih */
  917.    Connections[cnum].ngroups = 0;
  918. diff -u -r --new-file last-version/source/smb.h samba-1.9.14alpha8/source/smb.h
  919. --- last-version/source/smb.h    Wed Jul  5 17:31:29 1995
  920. +++ samba-1.9.14alpha8/source/smb.h    Thu Jul  6 17:51:56 1995
  921. @@ -548,6 +548,7 @@
  922.  };
  923.  
  924.  /* and a few prototypes */
  925. +void BlockSignals(BOOL block);
  926.  void msleep(int t);
  927.  int file_lock(char *name,int timeout);
  928.  void file_unlock(int fd);
  929. diff -u -r --new-file last-version/source/trans2.c samba-1.9.14alpha8/source/trans2.c
  930. --- last-version/source/trans2.c    Wed Jul  5 14:37:32 1995
  931. +++ samba-1.9.14alpha8/source/trans2.c    Thu Jul  6 13:57:15 1995
  932. @@ -346,6 +346,24 @@
  933.    p = pdata;
  934.    name_ptr = p;
  935.  
  936. +#ifdef MANGLE_LONG_FILENAMES
  937. +  {
  938. +    BOOL illegal = False;
  939. +    int i;
  940. +    int l = strlen(fname);
  941. +    for (i=0;i<l;i++) 
  942. +      if (strchr("*\\/?<>|\":{}",fname[i])) {
  943. +    illegal = True;
  944. +    break;
  945. +      }
  946. +    if (illegal) {
  947. +      fstring fname2;
  948. +      name_convert(fname2,fname,True,NULL);
  949. +      strcpy(fname,fname2);
  950. +    }    
  951. +  }
  952. +#endif
  953. +
  954.    switch (info_level)
  955.      {
  956.      case 1:
  957. diff -u -r --new-file last-version/source/util.c samba-1.9.14alpha8/source/util.c
  958. --- last-version/source/util.c    Wed Jul  5 17:38:14 1995
  959. +++ samba-1.9.14alpha8/source/util.c    Thu Jul  6 17:59:44 1995
  960. @@ -243,11 +243,17 @@
  961.  ****************************************************************************/
  962.  BOOL next_token(char **ptr,char *buff,char *sep)
  963.  {
  964. -  char *s = *ptr;
  965. +  static char *last_ptr=NULL;
  966. +  char *s;
  967.    BOOL quoted;
  968.  
  969. +  if (!ptr) ptr = &last_ptr;
  970. +  if (!ptr) return(False);
  971. +
  972. +  s = *ptr;
  973. +
  974.    /* default to simple separators */
  975. -  if (!sep) sep = " \t";
  976. +  if (!sep) sep = " \t\n\r";
  977.  
  978.    /* find the first non sep char */
  979.    while(*s && strchr(sep,*s)) s++;
  980. @@ -264,57 +270,67 @@
  981.      *buff++ = *s;
  982.      }
  983.  
  984. -  *ptr = (*s) ? s+1 : s;
  985. +  *ptr = (*s) ? s+1 : s;  
  986.    *buff = 0;
  987. +  last_ptr = *ptr;
  988.  
  989.    return(True);
  990.  }
  991.  
  992.  /*******************************************************************
  993.  safely copies memory, ensuring no overlap problems.
  994. +this is only used if the machine does not have it's own memmove().
  995. +this is not the fastest algorithm in town, but it will do for our
  996. +needs.
  997.  ********************************************************************/
  998.  void *MemMove(void *dest,void *src,int size)
  999.  {
  1000. -  /* do the copy in chunks of size difference. This relies on the 
  1001. -     capability of pointer comparison. */
  1002. -  int difference = PTR_DIFF(dest,src);
  1003. -  if (difference == 0 || size <= 0)
  1004. -    return(dest);
  1005. +  unsigned long d,s;
  1006. +  int i;
  1007. +  if (dest==src || !size) return(dest);
  1008.  
  1009. -  if (difference < 0) difference = -difference;
  1010. -  if (difference >= size) /* no overlap problem */
  1011. -    {
  1012. -      memcpy(dest,src,size);
  1013. -      return(dest);
  1014. -    }
  1015. +  d = (unsigned long)dest;
  1016. +  s = (unsigned long)src;
  1017. +
  1018. +  if ((d >= (s+size)) || (s >= (d+size))) {
  1019. +    /* no overlap */
  1020. +    memcpy(dest,src,size);
  1021. +    return(dest);
  1022. +  }
  1023.  
  1024. -  if (dest > src) /* copy the last chunks first */
  1025. +  if (d < s)
  1026.      {
  1027. -      char *this_dest=dest;
  1028. -      char *this_src=src;
  1029. -      this_dest += size - difference;
  1030. -      this_src += size - difference;
  1031. -      while (size>0)
  1032. -    {
  1033. -      memcpy(this_dest,this_src,difference);
  1034. -      this_dest -= difference;
  1035. -      this_src -= difference;
  1036. -      size -= difference;
  1037. -    }
  1038. +      /* we can forward copy */
  1039. +      if (s-d >= sizeof(int) && 
  1040. +      !(s%sizeof(int)) && !(d%sizeof(int)) && !(size%sizeof(int))) {
  1041. +    /* do it all as words */
  1042. +    int *idest = (int *)dest;
  1043. +    int *isrc = (int *)src;
  1044. +    size /= sizeof(int);
  1045. +    for (i=0;i<size;i++) idest[i] = isrc[i];
  1046. +      } else {
  1047. +    /* simplest */
  1048. +    char *cdest = (char *)dest;
  1049. +    char *csrc = (char *)src;
  1050. +    for (i=0;i<size;i++) cdest[i] = csrc[i];
  1051. +      }
  1052.      }
  1053.    else
  1054. -    { /* copy from the front */
  1055. -      char *this_dest=dest;
  1056. -      char *this_src=src;
  1057. -      while (size>0)
  1058. -    {
  1059. -      memcpy(this_dest,this_src,difference);
  1060. -      this_dest += difference;
  1061. -      this_src += difference;
  1062. -      size -= difference;
  1063. -    }
  1064. +    {
  1065. +      /* must backward copy */
  1066. +      if (d-s >= sizeof(int) && 
  1067. +      !(s%sizeof(int)) && !(d%sizeof(int)) && !(size%sizeof(int))) {
  1068. +    /* do it all as words */
  1069. +    int *idest = (int *)dest;
  1070. +    int *isrc = (int *)src;
  1071. +    size /= sizeof(int);
  1072. +    for (i=size-1;i>=0;i--) idest[i] = isrc[i];
  1073. +      } else {
  1074. +    /* simplest */
  1075. +    char *cdest = (char *)dest;
  1076. +    char *csrc = (char *)src;
  1077. +    for (i=size-1;i>=0;i--) cdest[i] = csrc[i];
  1078. +      }      
  1079.      }
  1080.    return(dest);
  1081.  }
  1082. @@ -458,14 +474,14 @@
  1083.    t = time(NULL);
  1084.  #ifdef NO_STRFTIME
  1085.    strcpy(TimeBuf, asctime(LocalTime(&t,GMT_TO_LOCAL)));
  1086. -#elif defined(CLIX)
  1087. +#elif defined(CLIX) || defined(CONVEX)
  1088.    strftime(TimeBuf,100,"%m/%d/%y %I:%M:%S %p",LocalTime(&t,GMT_TO_LOCAL));
  1089.  #elif defined(AMPM)
  1090.    strftime(TimeBuf,100,"%D %r",LocalTime(&t,GMT_TO_LOCAL));
  1091.  #elif defined(TZ_TIME)
  1092.    {
  1093.      strftime(TimeBuf,100,"%D:%T",LocalTime(&t,0));
  1094. -    sprintf(TimeBuf+strlen(TimeBuf)," %+02d%02d",
  1095. +    sprintf(TimeBuf+strlen(TimeBuf)," %+03d%02d",
  1096.          -TimeDiff(t)/(60*60),-(TimeDiff(t)/60)%60);
  1097.    }
  1098.  #else
  1099. @@ -739,7 +755,7 @@
  1100.               &t.tm_mday,&t.tm_hour,&t.tm_min,&t.tm_sec);
  1101.    t.tm_wday = 1;
  1102.    t.tm_yday = 1;
  1103. -  t.tm_isdst = 0;
  1104. +  t.tm_isdst = -1;
  1105.  
  1106.    return (TimeLocal(&t,GMT_TO_LOCAL));
  1107.  }
  1108. @@ -3595,7 +3611,7 @@
  1109.  int interpret_long_filename(int level,char *p,file_info *finfo)
  1110.  {
  1111.    if (finfo)
  1112. -    *finfo = def_finfo;
  1113. +    memcpy(finfo,&def_finfo,sizeof(*finfo));
  1114.  
  1115.    switch (level)
  1116.      {
  1117. @@ -3854,6 +3870,21 @@
  1118.    return(name);
  1119.  }
  1120.  
  1121. +/*******************************************************************
  1122. +block sigs
  1123. +********************************************************************/
  1124. +void BlockSignals(BOOL block)
  1125. +{
  1126. +#ifdef USE_SIGBLOCK
  1127. +  int block_mask = (sigmask(SIGTERM)|sigmask(SIGQUIT)|sigmask(SIGSEGV)
  1128. +            |sigmask(SIGCHLD)|sigmask(SIGQUIT)|sigmask(SIGBUS)|
  1129. +            sigmask(SIGINT));
  1130. +  if (block) 
  1131. +    sigblock(block_mask);
  1132. +  else
  1133. +    sigunblock(block_mask);
  1134. +#endif
  1135. +}
  1136.  
  1137.  #ifdef USE_DIRECT
  1138.  #define DIRECT direct
  1139. diff -u -r --new-file last-version/source/version.h samba-1.9.14alpha8/source/version.h
  1140. --- last-version/source/version.h    Wed Jul  5 18:54:04 1995
  1141. +++ samba-1.9.14alpha8/source/version.h    Thu Jul  6 18:11:04 1995
  1142. @@ -1 +1 @@
  1143. -#define VERSION "1.9.14alpha7"
  1144. +#define VERSION "1.9.14alpha8"
  1145.